#pragma once
#include <forward_list>
#include <any>

enum class EventStatus {
	Routing = 0,
	Working = 1,
	Done = 2

};
class EventLoop;
class Event { 
public:
	uint32_t type;
	EventStatus status;
	std::forward_list<EventLoop*> sender;
	std::any payload;

	void setDone() { status = EventStatus::Done; };
	template<typename T>
	void setPayload(T&& r) { payload = r;  };
	


	template<typename T>
	T&& getPayload() { return std::any_cast<T>(std::move(payload)); }
};